package bean.shoppingCard;

import java.util.ArrayList;

public class ShoppingCart {

	//local variable that holds the list of the products
	private ArrayList<ShoppingProduct> productList;
	
	//constructor that initialize the list
	public ShoppingCart() {	
		super();
		productList = new ArrayList<ShoppingProduct>();
		
	}

	public ArrayList<ShoppingProduct> getProducts() {
		return productList;
	}

	public void setProducts(ArrayList<ShoppingProduct> products) {
		this.productList = products;
	}
	
	public double calcTotal(){
		
		double total = 0;
		for(ShoppingProduct p : productList){
			total += p.getPrice();
		}
		return total;
	}
}
